package com.cloud.model;

import com.cloud.base.BaseEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "tb_opusType")
@EntityListeners(AuditingEntityListener.class)
public class OpusType extends BaseEntity {
    private String name;
    @OneToMany(mappedBy = "opusType",cascade = {CascadeType.MERGE,CascadeType.PERSIST})
    private Set<Opus>opuses=new HashSet<>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<Opus> getOpuses() {
        return opuses;
    }

    public void setOpuses(Set<Opus> opuses) {
        this.opuses = opuses;
    }
}
